package com.ruoyi.project.tool.swagger.UserController;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.system.domain.SysAttribute;
import com.ruoyi.project.system.service.ISysAttributeService;
import com.ruoyi.project.system.service.ISysTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 分类属性Controller
 *
 * @author jjp
 * @date 2020-04-20
 */
@RestController
@Api(description = "用户端分类属性")
@RequestMapping("/mobileUser/attribute")
public class UserAttributeController extends BaseController {
    @Autowired
    private ISysAttributeService sysAttributeService;
    @Autowired
    private ISysTypeService sysTypeService;

    /**
     * 获取分类属性详细信息
     */
    @ApiOperation("根据typeId获取分类属性详细信息")
    @GetMapping(value = "/getInfoByTypeId/{typeId}")
    public AjaxResult getInfoByTypeId(@PathVariable("typeId") Long typeId) {
        List<SysAttribute> sysAttributes = sysAttributeService.selectSysAttributeByTypeId(typeId);
        return AjaxResult.success(sysAttributes);
    }
}
